package com.lagou.minicat;

import com.lagou.minicat.core.Server;

public class Bootstrap {

    private static Server configServer;

    public static void main(String[] args) throws Exception {
        Bootstrap bootstrap = new Bootstrap();
        bootstrap.init();
        bootstrap.start();
    }

    /**
     * 初始化Minicat
     */
    private void init() throws Exception {
        Server server = new Server();
        server.init();
        configServer = server;
    }

    /**
     * 启动Minicat，开始监听http请求
     *
     * @throws Exception
     */
    private void start() throws Exception {
        configServer.getService().getConnector().start();
    }

}
